Skip to content

refactor: extract aiohttp transport - #470

Merged
alexanto merged 3 commits into
mainfrom
refactor/extract-aiohttp-transport
Nov 10, 2026
Merged

alexanto merged 3 commits into
mainfrom
refactor/extract-aiohttp-transport

Conversation

@alexanto

@alexanto alexanto commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

async counterpart of #469

@alexanto
alexanto added this pull request to stack #468 November 3, 2026 14:23
@gastonfournier gastonfournier moved this from New to In Progress in Issues and PRs Nov 4, 2026
@alexanto
alexanto requested a balanced review from Copilot November 5, 2026 13:28
@alexanto
alexanto force-pushed the refactor/extract-aiohttp-transport branch from 72c4bb7 to d26be36 Compare November 5, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Malformed UTF-8 can overwrite cached feature state with altered values, and truncated error-response bodies can bypass configured retries.

2 open issues
What changed in this PR

Extracts aiohttp request handling into a dedicated async transport, mirroring the synchronous transport separation in #469 and preparing the async client for custom HTTP transports.

Changes:

  • Adds an AsyncTransport protocol and a pooled AiohttpTransport implementation.
  • Routes async API requests through an injectable transport with explicit ownership and cleanup.
  • Adds transport tests and updates API-client tests for the new structure.
File Description
UnleashClient/​_transport.py Defines the async transport protocol.
UnleashClient/​_async_unleash_api_client.py Delegates HTTP operations and manages default transport ownership.
UnleashClient/​_aiohttp_transport.py Implements aiohttp requests, timeouts, and session lifecycle.
tests/​unit_tests/​test_async_unleash_api_client.py Tests transport injection, request construction, and cleanup ownership.
tests/​unit_tests/​test_async_metrics.py Updates the lazy-session assertion for transport-owned sessions.
tests/​unit_tests/​test_aiohttp_transport.py Tests requests, responses, errors, session reuse, and closure.

Review effort: Balanced

Comment thread UnleashClient/_transport.py Resolved
@github-project-automation github-project-automation Bot moved this from In Progress to Approved PRs in Issues and PRs Nov 9, 2026
Base automatically changed from refactor/extract-requests-transport to main November 10, 2026 11:27
@alexanto
alexanto force-pushed the refactor/extract-aiohttp-transport branch from d26be36 to 2417ccc Compare November 10, 2026 11:27
@alexanto
alexanto force-pushed the refactor/extract-aiohttp-transport branch from 2417ccc to 64a18eb Compare November 10, 2026 13:05
@alexanto
alexanto merged commit 5b2ed17 into main Nov 10, 2026
8 checks passed
@alexanto
alexanto deleted the refactor/extract-aiohttp-transport branch November 10, 2026 13:31
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Issues and PRs Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants